﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DaftarRekomendasi.aspx.cs" Inherits="SIAKAD.Dosens.DaftarRekomendasi" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>SIAKAD - DOSEN</title>

    <!-- normalize.css -->
    <link href="../Content/normalize.css" rel="stylesheet" />

    <!-- Bootstrap -->
    <link href="../Content/bootstrap.min.css" rel="stylesheet" />

    <!-- SIAKAD style -->
    <link href="../Content/Css/Siakad.css" rel="stylesheet" />

    <!-- Login style -->
    <link href="../Content/Css/Login.css" rel="stylesheet" />
    
    <!-- jQuery -->
    <script src="../Scripts/jquery-2.1.0.min.js"></script>
    <script src="../Scripts/bootstrap.min.js"></script>

    <!-- SIAKAD script -->
    <script src="../Scripts/Js/Siakad.js"></script>
    <script src="../Scripts/Js/Dosen/DaftarRekomendasi.js"></script>

    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
      <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body>
    <form id="frmDaftarRekomendasi" runat="server">
        <asp:ScriptManager ID="scriptManager" runat="server" />

        <!-- navbar -->
        <div class="navbar navbar-default navbar-fixed-top" role="navigation">
            <div class="container">
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                        <span class="sr-only">Toggle navigation</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    <a class="navbar-brand" href="#">SIAKAD</a>
                </div>
                <div class="navbar-collapse collapse">
                    <ul class="nav navbar-nav">
                        <li><a href="../Dosen.aspx">Home</a></li>
                    </ul>
                    <ul class="nav navbar-nav pull-right">
                        <li class="dropdown">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown"><asp:Literal ID="litName" runat="server" />&nbsp;<b class="caret"></b></a>
                            <ul class="dropdown-menu pull-right">
                                <li><asp:LinkButton ID="lnkLogout" runat="server" Text="Logout" OnClick="lnkLogout_Click" /></li>                     
                            </ul>
                        </li>
                    </ul>
                </div>
            </div>
        </div>

        <div class="container">
            <h3>Daftar Rekomendasi</h3>

            <asp:UpdatePanel ID="upCrudGrid" runat="server">
                <ContentTemplate>
                    <div class="row">
                        <div class="container">
                                <div class="form-group">
                                    <label for="ddlPilihPertanyaan">Pertanyaan</label>
                                    <asp:DropDownList ID="ddlPilihPertanyaan" runat="server" CssClass="form-control"  AutoPostBack="true" />
                                    <asp:HiddenField ID="hfPilihPertanyaan" runat="server" />
                                </div>
                                <div class="form-group">
                                    <asp:Button ID="btPilih" runat="server" Text="Pilih" CssClass="btn btn-primary pull-right" OnClick="btPilih_Click" />
                                </div>
                            </div>
                    </div>

                    <div class="row">
                        <div class="container" style="margin-top:10px">
                     <asp:GridView ID="gvDaftarRekomendasi" runat="server"
                        CellSpacing="-1" GridLines="None"
                        CssClass="table table-hover" AutoGenerateColumns="false"
                        OnRowCommand="gvDaftarRekomendasi_RowCommand" DataKeyNames="pertanyaan"
                        AllowPaging="true" OnPageIndexChanging="gvDaftarRekomendasi_PageIndexChanging" PageSize="10" OnSelectedIndexChanged="gvDaftarRekomendasi_SelectedIndexChanged">
                        <Columns>
                            <asp:TemplateField HeaderStyle-Width="70px" HeaderText="NO"> 
                                <ItemTemplate> 
                                    <%# Container.DataItemIndex + 1 %>. 
                                </ItemTemplate> 
                                <ItemStyle HorizontalAlign="Right" /> 
                            </asp:TemplateField>                
                            <asp:BoundField DataField="rekomendasi" HeaderText="REKOMENDASI" />
                            <asp:ButtonField CommandName="updateRecord" Text="<span class='glyphicon glyphicon-edit'></span> EDIT" ButtonType="Link" HeaderStyle-Width="70px" />
                            <asp:ButtonField CommandName="deleteRecord" Text="<span class='glyphicon glyphicon-remove'></span> DELETE" ButtonType="Link" HeaderStyle-Width="90px" />
                        </Columns>
                        <PagerSettings FirstPageText="First" LastPageText="Last" 
                            Mode="NumericFirstLast" PageButtonCount="5" NextPageText="Next" PreviousPageText="Prev" position="Bottom" />
                        <PagerStyle HorizontalAlign = "Center" CssClass = "GridPager" />
                    </asp:GridView>
                     <div style="text-align:center; margin:20px">
                        <asp:Button ID="btAdd" runat="server" Text="Tambah Rekomendasi" CssClass="btn btn-default" OnClick="btAdd_Click" />
                         </div>
                            </div>
                    </div>
                </ContentTemplate>
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="btAdd" EventName="Click" />
                </Triggers>
            </asp:UpdatePanel>
        </div>

        <div id="editModal" class="modal fade">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                        <h4 class="modal-title"><span class="glyphicon glyphicon-pencil"></span> Ubah Rekomendasi</h4>
                    </div>
                    <asp:UpdatePanel ID="upEdit" runat="server">
                        <ContentTemplate>
                            <div class="modal-body">
                                <div class="form-group">
                                    <label for="txtEditRekomendasi">Rekomendasi</label>
                                    <asp:TextBox ID="txtEditRekomendasi" runat="server" TextMode="MultiLine"
                                        CssClass="form-control" style = "resize:none" Rows="3" />
                                    <asp:HiddenField ID="hfUpdateRekomendasi" runat="server" />
                                </div>
                            </div>
                            <div class="modal-footer">
                                <button type="button" class="btn btn-default" data-dismiss="modal">Batal</button>
                                <asp:Button ID="btEditDaftarRekomendasi" runat="server" Text="Ubah" CssClass="btn btn-primary" OnClick="btEditDaftarRekomendasi_Click" />
                            </div>
                        </ContentTemplate>
                        <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="gvDaftarRekomendasi" EventName="RowCommand" />
                            <asp:AsyncPostBackTrigger ControlID="btEditDaftarRekomendasi" EventName="Click" />
                        </Triggers>
                    </asp:UpdatePanel>
                </div>
            </div>            
        </div>

      <div id="addModal" class="modal fade">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                        <h4 class="modal-title"><span class="glyphicon glyphicon-plus"></span> Tambah Rekomendasi</h4>
                    </div>
                    <asp:UpdatePanel ID="upAdd" runat="server">
                        <ContentTemplate>
                            <div class="modal-body">
                                <div class="form-group">
                                    <label for="txtAddDaftarRekomendasi">Rekomendasi</label>
                                    <asp:TextBox ID="txtAddDaftarRekomendasi" runat="server" TextMode="MultiLine"
                                        CssClass="form-control" style = "resize:none" Rows="3" />
                                </div>
                            </div>
                            <div class="modal-footer">
                                <button type="button" class="btn btn-default" data-dismiss="modal">Batal</button>
                                <asp:Button ID="btAddDaftarRekomendasi" runat="server" Text="Tambah" CssClass="btn btn-primary" OnClick="btAddDaftarRekomendasi_Click" />
                            </div>
                        </ContentTemplate>
                        <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="btAddDaftarRekomendasi" EventName="Click" />
                        </Triggers>
                    </asp:UpdatePanel>
                </div>
               
            </div>
        </div>

        <div id="deleteModal" class="modal fade">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                        <h4 class="modal-title"><span class="glyphicon glyphicon-trash"></span> Hapus Rekomendasi</h4>
                    </div>
                    <asp:UpdatePanel ID="upDelete" runat="server">
                        <ContentTemplate>
                            <div class="modal-body">
                                <p>Anda yakin ingin menghapus rekomendasi ini ini?</p><asp:HiddenField ID="hfDeleteID" runat="server" />
                            </div>
                            <div class="modal-footer">
                                <button type="button" class="btn btn-default" data-dismiss="modal">Batal</button>
                                <asp:Button ID="btDeleteRekomendasi" runat="server" Text="Hapus" CssClass="btn btn-primary" OnClick="btDeleteRekomendasi_Click" />
                            </div>
                        </ContentTemplate>
                        <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="btDeleteRekomendasi" EventName="Click" />
                        </Triggers>
                    </asp:UpdatePanel>
                </div>
            </div>
        </div>

        <div id="footer">
            <div class="container">
                <p class="text-muted">&copy; <%: DateTime.Now.Year.ToString() %> Rezki Wulan Permata Sari</p>
            </div>
        </div>
    </form>
</body>
</html>
